package com.example.demo.entity;

import com.alibaba.fastjson.annotation.JSONField;

import java.io.Serializable;

/**
 * @version
 * @apiNote 这个类为离线信息对象，这个类的对象用于存储发送信息的用户id，发送的离线信息，信息发往的用户id，信息发送的时间戳
 * 使用fastJSON api对对象进行序列化和反序列化
 */
public class Message implements Serializable {
    @JSONField(name = "fromId")
    private String fromId;
    @JSONField(name = "ToId")
    private String toId;
    @JSONField(name = "message")
    private String message;
    @JSONField(name = "timeStamp")
    private long timeStamp;
    @JSONField(name = "type")
    private int type;
    //普通信息类型:0

    public void setType(int type) {
        this.type = type;
    }

    public String getFromId() {
        return fromId;
    }

    public void setFromId(String fromId) {
        this.fromId = fromId;
    }

    public int getType() {
        return type;
    }

    public String getToId() {
        return toId;
    }

    public void setToId(String toId) {
        this.toId = toId;
    }

    public String getMessage() {
        return this.message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public long getTimeStamp() {
        return timeStamp;
    }

    public void setTimeStamp(long timeStamp) {
        this.timeStamp = timeStamp;
    }


    public Message(String fromId, String toId, String message,long timeStamp){
        this.fromId = fromId;
        this.toId = toId;
        this.message = message;
        this.timeStamp = timeStamp;
    }
    public Message(){
        super();
    }
}
